SYS.MEM.ALLOC
0x0000
NET.UPLINK
ESTABLISHING
SEC.PROTOCOL
AWAITING
DATA.STREAM
0.0.0.0
0%
INITIALIZING SYSTEM
[
]
Portfolio Learn Month 02 Networking Basics

🌐 Day 13: HTTP

Networking Web HTTP

HTTP (HyperText Transfer Protocol) is the language of the web. It is a "Request-Response" protocol. 🌐


1. What is HTTP?

Hacker Insight: HTTP is plain text. If you are on an unencrypted Wi-Fi, a hacker using a tool like Wireshark can read your HTTP requests exactly like reading a text message.


2. HTTP vs. HTTPS

Feature HTTP (Insecure) HTTPS (Secure)
Encryption None. Data is "in the clear." Encrypted via TLS/SSL.
Port 80 443
Hacker's View Easy to "sniff" passwords. Must use advanced "Man-in-the-Middle" (MITM) attacks.

3. Client vs. Server


4. Request vs. Response

This is the heartbeat of the web. Every single "click" triggers this cycle.

A. The Request (What you send)

GET /profile.php HTTP/1.1
Host: socialmedia.com
User-Agent: Mozilla/5.0
Cookie: session_id=abc123xyz

B. The Response (What you get back)

HTTP/1.1 200 OK
Content-Type: text/html

<html><body>Welcome, Usman!</body></html>

5. The "Stateless" Concept (The Amnesia Problem)

HTTP is stateless. This means the server has a memory of exactly 0 seconds. It doesn't know that the person who just asked for profile.php is the same person who logged in 5 seconds ago.


6. What happens when you type a URL?

(Example: https://google.com)

  1. DNS Lookup: Your computer turns "google.com" into an IP address (e.g., 142.250.190.46). Hacker trick: DNS Spoofing can send you to a fake IP.
  2. The Handshake: Your computer establishes a TCP connection (the "Hello" phase).
  3. The Request: Your browser sends the HTTP GET request.
  4. Processing: The server checks its database.
  5. The Response: The server sends back the HTML/CSS/JS.
  6. Rendering: Your browser paints the pretty website on your screen.

🛠️ Practical 1: "The Developer's Eye"

Task: See the "text" behind the beauty.

  1. Open any website in Chrome.
  2. Right-click anywhere and click Inspect.
  3. Go to the Network tab.
  4. Refresh the page.
  5. Click on the first item in the list (usually the name of the website).
  6. Look at Headers. You are now seeing the raw Request and Response.